package com.androidmvp.dreammvp.simple7.base;

import android.os.Bundle;

/**
 * Created by admin on 2017/9/5.
 */

public class MvpActivityDelegateImpl_7<V extends MvpView,P extends MvpPresenter<V>> implements MvpActivityDelegate_7<V,P> {

    private ProxyMvpCallback<V, P> proxyMvpCallback;
    private MvpCallback<V, P> mvpCallback;

    public MvpActivityDelegateImpl_7(MvpCallback<V, P> mvpCallback){
        this.mvpCallback = mvpCallback;
        if (mvpCallback == null){
            throw new NullPointerException("不能够为空");
        }
        this.proxyMvpCallback = new ProxyMvpCallback<>(mvpCallback);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        //绑定处理
        this.proxyMvpCallback.createPresenter();
        this.proxyMvpCallback.createView();
        this.proxyMvpCallback.attachView();
    }

    @Override
    public void onStart() {

    }

    @Override
    public void onPause() {

    }

    @Override
    public void onResume() {

    }

    @Override
    public void onRestart() {

    }

    @Override
    public void onStop() {

    }

    @Override
    public void onDestory() {
        this.proxyMvpCallback.detachView();
    }
}
